﻿using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;
using Web.App.Infrastructure.CrossCuttingConcerns.Handlers;
using Webshop20.Application;
using Webshop20.Application.Operations.Services;

namespace Webshop20.Configuration
{
    public class UnityConfiguration
    {
        public UnityConfiguration()
        {
            IUnityContainer container = new UnityContainer();
            container.RegisterType<ICallHandler, TransactionHandler>("TransactionHandler");
            container.AddNewExtension<Interception>();
            container
                .Configure<Interception>()
                .SetDefaultInterceptorFor<SaveNewRegistrationService>(new VirtualMethodInterceptor());
                
                
        }
    }
}